package com.dasberg.gwt.dispatch;

import com.dasberg.gwt.command.Action;
import com.dasberg.gwt.command.Result;


/**
 * Handler interface.
 * A Handler will process the generic parameter type Action.
 * @author mischa
 */
public interface Handler<Action> {
    /**
     * Handles a Action.
     * @param action The action.
     */
    Result process(Action action) throws ActionException;

    /**
     * Rollsback an Action.
     * @param action The action.
     */
    void rollback(Action action);

    /**
     * Returns the Action class.
     * @return class The Action type class.
     */
    Class<Action> getActionClass();
}
